Link Layer
Tags: #◇Computer Science #◇CSNETWK #◇Link Layer #◇Conceptual
◇Overview
The Link Layer is responsible for transferring a datagram from one node (host or router) to an adjacent node over a specific link (wired, wireless, LAN). A datagram is encapsulated into a layer-2 packet known as a frame. Because a datagram may pass through various types of links (e.g., Ethernet, WiFi), different link protocols apply and offer different services. The link layer is typically implemented in the Network Interface Card (NIC) which attaches to the host's system buses.
Link Layer Services
- Framing & Link Access: Encapsulating a datagram into a frame by adding a header and a trailer. Managing access to a shared medium.
- Addressing: Uses MAC addresses in frame headers to identify the source and destination at the local level.
- Reliable Delivery: Ensures frames are delivered correctly between adjacent nodes. (Often used for wireless links due to high error rates).
- Flow Control: Pacing the transmission rate between adjacent sending and receiving nodes.
- Error Detection & Correction: Receiver detects errors (e.g., via cyclic redundancy check, CRC) and either requests retransmission or corrects the bit errors directly.
- Duplexing: Half-duplex (nodes can transmit but not at the same time) or full-duplex (simultaneous transmission).
MAC Addresses and ARP MAC Address: A 48-bit flat identifier (like a Social Security Number) burned into the NIC's ROM and administered by IEEE. It uniquely identifies an interface locally on a LAN. Unlike a hierarchical IP address (like a postal address), a MAC address is portable and doesn't change when the node moves. ARP (Address Resolution Protocol): Translates an IP address into a MAC address. Each IP node keeps an ARP Table mapping IP addresses to MAC addresses with a Time To Live (TTL). If an IP isn't in the table, the node broadcasts an ARP Query frame to the special MAC address FF-FF-FF-FF-FF-FF, and the target node replies with its MAC address.
Ethernet
The dominant wired LAN technology. It is simple, cheap, and capable of speeds from 10 Mbps to over 400 Gbps. Characteristics: Connectionless (no handshaking) and unreliable (does not send ACKs or NAKs). Errors require higher-layer recovery (like TCP). Relies on the CSMA/CD protocol. Ethernet Frame Structure:
Preamble: 8 bytes used to synchronize clock rates (seven bytes of 10101010 and one byte of 10101011).
Addresses: 6-byte source and destination MAC addresses.
Type: Indicates the higher-layer protocol (mostly IP) to demultiplex the payload.
Data (Payload): The encapsulated IP datagram.
CRC: Cyclic Redundancy Check for error detection.
Ethernet Switches
Switches are active link-layer devices that store and forward Ethernet frames. Transparent and Plug-and-Play: Hosts are unaware of switches, and switches are self-learning (they require no manual configuration). Multiple Simultaneous Transmissions: A switch maintains dedicated, direct connections to hosts and buffers packets. Because each link is its own collision domain using full-duplex Ethernet, there are no collisions, and multiple hosts can transmit simultaneously (e.g., A to A' and B to B') as long as they target different destination ports.
◇Important Formulas
(No specific formulas were discussed in this module)
◇Worked Examples
Example 1: End-to-End Delivery Across Subnets
When Host A wants to send a datagram to Host B on a different subnet through Router R:
- Host A encapsulates the IP datagram (Source IP: A, Dest IP: B) into a frame. The frame's destination MAC address is Router R's MAC.
- Router R receives the frame, extracts the datagram, and checks the IP destination.
- Router R determines the outgoing interface for B, creates a new link-layer frame encapsulating the same IP datagram, and sets the frame's destination MAC address to B's MAC address.
- B receives the frame, extracts the datagram, and passes it up the protocol stack.
◇References & Navigation
- Previous Topic: ◇Bellman Ford Distance Vector Algorithm
- Next Topic: ◇Addressing and Forwarding
- Related Notes: ◇Internetworking
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
What are the core services provided by the Data Link Layer (Layer 2)?
Where in a host computer is the Link Layer primarily implemented?
In Cyclic Redundancy Check (CRC) error detection using a degree- generator polynomial (having bits), how does the sender compute the -bit CRC remainder for a data bitstring , and how does the receiver verify it?
Which class of Multiple Access Control (MAC) protocol do CSMA/CD (Ethernet) and CSMA/CA (802.11 Wi-Fi) belong to, and how do they differ from Channel Partitioning (TDMA/FDMA) and Taking Turns (Token Passing / Polling)?
In Ethernet's Binary Exponential Backoff algorithm after a frame experiences its -th consecutive collision (for ), from what discrete set does the NIC choose the random number of -bit-time slot delays to wait before re-attempting transmission?